package org.example.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.example.entity.Order;
import org.example.mapper.OrderMapper;
import org.example.service.IOrderService;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class OrderServiceImpl implements IOrderService{

    @Resource
    private OrderMapper orderMapper;

    @Override
    public PageInfo<Order> selectByPage(int page, int limit) {
        PageHelper.startPage(page,limit);
        List<Order> orderList = orderMapper.selectByExample(null);
        return new PageInfo<Order>(orderList);
    }
}
